/**
 * 
 */
package cn.egame.extraction.timer;

import org.apache.log4j.Logger;

import cn.egame.common.util.Utils;
import cn.egame.extraction.FileSynchronizeSchduler;
import cn.egame.extraction.util.ConstVar_EFS;

/**
 * Description 定时器启动任务
 * 
 * @ClassName ExtractionServerTask
 * 
 * @Copyright 炫彩互动
 * 
 * @Project egame.mobile.extraction
 * 
 * @Author yujm
 * 
 * @Create Date 2014-12-05
 * 
 * @Modified by none
 * 
 * @Modified Date
 */

public class ExtractionTimeTask {
    private static final Logger logger = Logger.getLogger(ExtractionTimeTask.class);

    public static void main(String[] args) {
        Utils.initLog4j();
        new Thread(new FileSynchronizeSchduler()).start();
        while (true) {
            if (FileSynchronizeSchduler.flag.get()) {
                FileSynchronizeSchduler schduler = new FileSynchronizeSchduler();
                Thread thread = new Thread(schduler);
                thread.start();
            }
            try {
                Thread.sleep(ConstVar_EFS.PROCESS_PER_TIME);
            } catch (InterruptedException e) {
                logger.error(e.getMessage(), e);
            }

        }

    }

}
